from django.core.mail import send_mail
from django.conf import settings
from celery_tasks.main import celery_app


@celery_app.task(name='send_user_mail')
def send_user_mail(to_email, url):
    subject = '博学谷-邮箱重置'
    msg = '<p>请点击下面链接重置你的密码: </p>' \
          '<p><a href="%s">%s<a></p>' % (url, url)
    send_mail(subject, '', settings.EMAIL_FROM, [to_email], html_message=msg)
